<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: register.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."register.php";
include LOCALE.LOCALESET."user_fields.php";

//ny info om avloser
$avloserid=$_POST['ud_avloserid'];
$ud_avloserid=$_POST['ud_avloserid'];
$ud_fornavn=$_POST['ud_fornavn'];
$ud_etternavn=$_POST['ud_etternavn'];
$ud_adresse=$_POST['ud_adresse'];
$ud_postnr=$_POST['ud_postnr'];
$ud_telefon=$_POST['ud_telefon'];
$ud_mobil=$_POST['ud_mobil'];
$ud_epost=$_POST['ud_epost'];
$ud_aktiv=$_POST['ud_aktiv'];
$selected=implode(',',$_POST['type']);

//Ny info om kurs
/*$ud_kaar=$_POST['ud_kaar'];
$ud_ktype=$_POST['ud_ktype'];
$ud_ksted=$_POST['ud_ksted'];*/

$db = mysql_connect($GLOBALS['db_host'], $GLOBALS['db_user'], $GLOBALS['db_password']);
mysql_select_db($GLOBALS['db_name'], $db);  

$query="UPDATE avloser SET fornavn='$ud_fornavn',etternavn='$ud_etternavn', adresse='$ud_adresse', postnr='$ud_postnr', 
		telefon='$ud_telefon', mobil='$ud_mobil', epost='$ud_epost', aktiv='$ud_aktiv', type='$selected' 
		WHERE avloserid='$ud_avloserid'";

mysql_query($query);

header("Refresh: 1; url='update_profil.php?avloserid=$avloserid'");

echo "Vellykket.";

require_once THEMES."templates/footer.php";
?>
